<template>
  <!-- 存货聚合页 -->
  <div id="stock-aggregate-page">
    <c-title :text="name"></c-title>
    <van-search v-model="goods_name" shape="round" placeholder="请输入商品名称" @search="onSearch"/>
    <d-list :loading="loading" :finished="finished" @load="onLoad">
      <div class="goods-box">
        <div class="goods-detail" v-for="(item, index) in listData" :key="index" @click="goGoodsDetail(item.id)">
          <img :src="item.thumb" alt="" />
          <div class="name-line">
            <div class="title">{{ item.title }}</div>
            <div class="price">￥{{ item.price }}</div>
          </div>
        </div>
      </div>
    </d-list>
    <van-popup v-model="popupShow" round position="center" :style="{ width: '17.75rem' }" get-container="#app">
      <div class="popup-box">
        <div class="popup-title">活动说明</div>
        <div class="popup-text-detail" v-html="explain"></div>
        <van-icon name="close" class="popup-close" @click="popupShow = false" />
      </div>
    </van-popup>
  </div>
</template>

<script>
import stockAggregatePage_controller from "./stockAggregatePage_controller";

export default stockAggregatePage_controller;
</script>

<style scoped>
.van-popup--center {
  top: 45%;
}

.van-popup {
  overflow-y: inherit;
}

.van-popup--center.van-popup--round {
  border-radius: 0.25rem;
}
</style>
<style lang="scss" rel="stylesheet/scss" scoped>
.popup-box {
  position: relative;

  .popup-title {
    text-align: center;
    font-size: 0.94rem;
    font-weight: bold;
    color: #161615;
    line-height: 1;
    margin: 1.19rem 0 0.88rem 0;
  }

  .popup-text-detail {
    font-size: 0.75rem;
    height: 14.5rem;
    font-weight: normal;
    color: #6e6e6e;
    line-height: 1.25rem;
    text-align: left;
    margin: 0 1.16rem 1.16rem 1.16rem;
    overflow: auto;
  }

  .popup-close {
    // zoom: 2;
    font-size: 1.6rem;
    position: absolute;
    bottom: -27%;
    left: 45%;
    z-index: 20000;
    color: white;
  }
}

#stock-aggregate-page {
  .goods-box {
    padding: 0 0.63rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;

    .goods-detail {
      width: 10.74rem;
      background: #fff;
      border-radius: 0 0 0.35rem 0.35rem;
      margin: 0.5rem 0 0 0;

      img {
        height: 10.74rem;
        background: #fff;
        border-radius: 0 0 0.32rem 0.32rem;
        margin: initial;
        width: 10.74rem;
        padding: 0.95rem;
      }

      .name-line {
        padding-bottom: 0.625rem;
        line-height: 1;

        .title {
          text-align: left;
          padding: 0 0.625rem;
        }

        .price {
          text-align: left;
          margin-top: 0.75rem;
          color: #e64a40;
          padding-left: 0.43rem;
        }
      }
    }
  }
}
</style>
